package ai.plantdata.Behavior.mode.IteratorPattern.test;

import ai.plantdata.Behavior.mode.IteratorPattern.interfaces.Iterator;
import ai.plantdata.Behavior.mode.IteratorPattern.interfaces.impl.NameRepository;


/**
 * @Author: WangHui
 * @Date: 2020/12/23 14:18
 * @Description:
 */
public class IteratorPatternDemo {
    public static void main(String[] args) {
        NameRepository nameRepository = new NameRepository();
        for(Iterator iter = nameRepository.getInterator(); iter.hasNext();){
            String name = (String)iter.nest();
            System.out.println("Name : " + name);
        }
    }
}
